import React from 'react';
import type { MenuProps } from 'antd';
import { Button, Dropdown, Space, Modal } from 'antd';
import IndexModal from './modal/index'
import IndexModal2 from './modal2/index'
import IndexModal3 from './modal3/index'
import ModalTime from './modalTime'
import RecordCopy from './recordCopy'
import YssjModal from './yssjModal'
import PlModal from './plModal'
import ZfModal from './zfModal'
import FlModal from './flModal'
import YqModal from './yqModal'
import BbModal from './bbModal'
import BbxsModal from './bbxsModal'
import YbztModal from './ybztModal'
const { confirm } = Modal;
const App: React.FC = () => {
    let ChildRef = React.createRef()
    let ChildRef2 = React.createRef()
    let ChildRef3 = React.createRef()
    let ModalTimeRef = React.createRef()
    let RecordCopyRef = React.createRef()
    let yssjRef = React.createRef()
    let plRef = React.createRef()
    let zfRef = React.createRef()
    let flRef = React.createRef()
    let yqRef = React.createRef()
    let bbxxRef = React.createRef()
    let sqxxRef = React.createRef()
    let ybztRef = React.createRef()
    const openModal = () => {
        ChildRef.current.showModal()
    }
    const openModal2 = () => {
        ChildRef2.current.showModal()
    }
    const openModal3 = () => {
        ChildRef3.current.showModal()
    }
    const wx = () => {
        confirm({
            title: '问询',
            content: '确认对授权报告打印',
            onOk() {
                console.log('OK');
            },
            onCancel() {
                console.log('Cancel');
            },
        });
    }
    const updataTime = () => {
        ModalTimeRef.current.showModal()
    }
    const recordCopy = () => {
        RecordCopyRef.current.showModal()
    }
    const yssj = () => {
        yssjRef.current.showModal()
    }

    const pldr = () => {
        plRef.current.showModal()
    }

    const zfxm = () => {
        zfRef.current.showModal()
    }
    const flRe = () => {
        flRef.current.showModal()
    }
    const xzyq = () => {
        yqRef.current.showModal()
    }

    const bbxx = () => {
        bbxxRef.current.showModal()
    }

    const sqxx = () => {
        sqxxRef.current.showModal()
    }

    const ybzt = () => {
        ybztRef.current.showModal()
    }
    const items: MenuProps['items'] = [
        {
            key: '1',
            label: (
                <a onClick={openModal}>
                    批量处理
                </a>
            ),
        },
        {
            key: '2',
            label: (
                <a onClick={openModal2}>
                    界面参数
                </a>
            ),
        },
        {
            key: '3',
            label: (
                <a onClick={openModal3}>
                    样本拒签
                </a>
            ),
        },
        {
            key: '4',
            label: (
                <a onClick={wx}>
                    问询
                </a>
            ),
        },
        {
            key: '5',
            label: (
                <a onClick={updataTime}>
                    修改时间
                </a>
            ),
        },
        {
            key: '6',
            label: (
                <a onClick={recordCopy}>
                    报告复制
                </a>
            ),
        },
        {
            key: '7',
            label: (
                <a onClick={yssj}>
                    原始数据
                </a>
            ),
        },
        {
            key: '8',
            label: (
                <a onClick={pldr}>
                    批量导入样本
                </a>
            ),
        },
        {
            key: '9',
            label: (
                <a onClick={zfxm}>
                    作废项目
                </a>
            ),
        },
        {
            key: '10',
            label: (
                <a onClick={flRe}>
                    复检
                </a>
            ),
        },
        {
            key: '11',
            label: (
                <a onClick={xzyq}>
                    选择仪器
                </a>
            ),
        },
        {
            key: '12',
            label: (
                <a onClick={bbxx}>
                    绑定标本信息
                </a>
            ),
        },
        {
            key: '13',
            label: (
                <a onClick={sqxx}>
                    绑定申请信息
                </a>
            ),
        },
        {
            key: '14',
            label: (
                <a onClick={ybzt}>
                    样本状态信息
                </a>
            ),
        },

    ]


    return (<Space direction="vertical">
        <Space wrap>
            <Dropdown menu={{ items }} placement="bottomLeft">
                <Button>更多操作</Button>
            </Dropdown>
        </Space>
        <IndexModal onRef={ChildRef} />
        <IndexModal2 onRef={ChildRef2} />
        <IndexModal3 onRef={ChildRef3} />
        <ModalTime onRef={ModalTimeRef} />
        <RecordCopy onRef={RecordCopyRef}/>
        <YssjModal onRef={yssjRef}/>
        <PlModal onRef={plRef} />
        <ZfModal onRef={zfRef} />
        <FlModal onRef={flRef} />
        <YqModal onRef={yqRef} />
        <BbModal onRef={bbxxRef} />
        <BbxsModal onRef={sqxxRef} />
        <YbztModal onRef={ybztRef}/>

    </Space>)
}

export default App;
